#include "ALBRead.h"


CALBRead::CALBRead()
{
	m_pStepItem = NULL;
}

CALBRead::CALBRead(CALStepItem* pStepItem)
{
	m_pStepItem = pStepItem;
}

CALBRead::~CALBRead()
{
}

void CALBRead::test()
{

}

void CALBRead::convert()
{
	if (m_pStepItem == NULL) return;

	try
	{
		CALSIBRead* pStepItem = (CALSIBRead*)m_pStepItem;
	
		String strFile = pStepItem->GetItemFileName();
		if (strFile.empty()) return;

		String strFile2 = pStepItem->GetItemFileName2();

		int nMs = pStepItem->GetItemMs();
		ImreadModes nFlag;
		switch (nMs)
		{
		case 0:nFlag = IMREAD_GRAYSCALE; break;
		case 1:nFlag = IMREAD_GRAYSCALE; break;
		case 2:nFlag = IMREAD_COLOR; break;
		default:nFlag = IMREAD_GRAYSCALE; break;
		}

		m_dstMat = imread(strFile, nFlag);

		if (strFile2.empty())
		{
			SetDstType(AL_DST_Mat_One);
		}
		else
		{
			m_dstMat1 = imread(strFile2, nFlag);

			SetDstType(AL_DST_Mat_Two);
		}

	}
	catch (...)
	{

	}
}

void CALBRead::convert(const Mat &src, Mat &dst)
{
	
}
